package org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.edit.policies;

import org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.edit.commands.Component2CreateCommand;
import org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.edit.commands.ReferenceCreateCommand;
import org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.edit.commands.ServiceCreateCommand;
import org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.providers.GeneralSOAPatternECOREMetamodelElementTypes;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;

/**
 * @generated
 */
public class CompositeCompositeCompartmentItemSemanticEditPolicy extends
		GeneralSOAPatternECOREMetamodelBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	public CompositeCompositeCompartmentItemSemanticEditPolicy() {
		super(GeneralSOAPatternECOREMetamodelElementTypes.Composite_2002);
	}

	/**
	 * @generated
	 */
	protected Command getCreateCommand(CreateElementRequest req) {
		if (GeneralSOAPatternECOREMetamodelElementTypes.Reference_3003 == req
				.getElementType()) {
			return getGEFWrapper(new ReferenceCreateCommand(req));
		}
		if (GeneralSOAPatternECOREMetamodelElementTypes.Service_3004 == req
				.getElementType()) {
			return getGEFWrapper(new ServiceCreateCommand(req));
		}
		if (GeneralSOAPatternECOREMetamodelElementTypes.Component_3005 == req
				.getElementType()) {
			return getGEFWrapper(new Component2CreateCommand(req));
		}
		return super.getCreateCommand(req);
	}

}
